package com.ruoyi.system.service.impl;

import com.ruoyi.system.mapper.SysSeqMapper;
import com.ruoyi.system.service.ISysSeqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 常用序列
 */
@Service
public class SysSeqServiceImpl implements ISysSeqService {
    private static String sysUser="sys_user";
    private static String sysRole="sys_role";
    private static String sysDept="sys_dept";
    @Autowired
    private SysSeqMapper seqMapper;
    @Override
    public String nextUserId() {
        return "U"+seqMapper.nextVal(sysUser);
    }

    @Override
    public String nextRoleId() {
        return "R"+seqMapper.nextVal(sysRole);
    }

    @Override
    public String nextDeptId() {
        return "D"+seqMapper.nextVal(sysDept);
    }
}
